package io.adrainty.bolee.framework.commons.basic;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author adrainty
 * @version v1.0.0
 * @since 2025/6/12 下午2:01
 */

@Getter
@AllArgsConstructor
@SuppressWarnings("unused")
public enum ResponseCode implements IEnum {

    SUCCESS("200", "成功"),

    USER_LOGIN_ERROR("100001", "用户名或密码错误"),
    USER_LOGIN_ERROR_TIME_LIMIT("100002", "登录错误次数超过限制, 请%s后再试"),
    USER_NOT_LOGIN("100003", "未登录"),
    USER_FORBIDDEN("100004", "非法操作"),
    USER_LOGIN_EXPIRED("100005", "登录已过期"),
    LOGIN_DOMAIN_ERROR("100006", "登录域名错误"),

    COMPANY_CREATE_ERROR("200001", "创建企业失败"),
    USER_CREATE_ERROR("200002", "创建用户失败"),
    DEPT_CREATE_ERROR("200003", "创建部门失败"),
    DEPT_NOT_FOUND("200004", "部门不存在"),
    ROLE_CREATE_ERROR("200005", "创建角色失败"),
    ROLE_UPDATE_ERROR("200006", "更新角色失败"),
    POST_CREATE_ERROR("200007", "创建岗位失败"),
    USER_UPDATE_ERROR("200008", "更新用户失败"),

    SAFEGUARD_CREATE_ERROR("500001", "创建保障项失败"),
    COEFFICIENT_CREATE_ERROR("500002", "创建保障系数失败"),
    CONDITION_CREATE_ERROR("500003", "创建筛选项失败"),
    CATEGORY_UPDATE_ERROR("500004", "更新分类项失败"),
    CATEGORY_NOT_EXIST("500005", "分类项不存在"),
    INSURANCE_CREATE_ERROR("500006", "创建保险失败"),
    INSURANCE_PLAN_CREATE_ERROR("500007", "创建保险计划失败"),
    INSURANCE_CALCULATE_ERROR("500008", "保险试算失败"),
    WARRANTY_ORDER_NOT_EXIST("500009", "订单不存在"),

    PAY_CHANNEL_NOT_EXIST("600001", "支付渠道不存在"),
    TRADE_ERROR("600002", "交易失败"),
    TRADE_STATE_ERROR("600003", "交易状态异常"),
    TRADE_NOT_EXIST("600004", "交易不存在"),
    CLOSE_TRADE_ERROR("600005", "关闭交易失败"),

    FILE_READ_ERROR("800001", "文件读取失败"),
    FILE_SAVE_ERROR("800002", "文件保存失败"),
    FILE_STORAGE_NOT_SUPPORT("800003", "存储空间不支持"),
    FILE_UPLOAD_ERROR("800004", "文件上传失败"),

    /**
     * 系统异常 9xxxxx
     */
    DUPLICATE_KEY("900001", "重复键值"),
    RETRY_LATER("900002", "请稍后再试"),
    INTERFACE_HYSTRIX("900003", "请稍后重试"),
    SERVICE_NOT_AVAILABLE("900004", "服务不可用"),
    LOCK_ERROR("900005", "请稍后重试"),

    ILLEGAL_PARAMETER("999990", "非法参数"),
    UN_ERROR("999999", "系统异常"),

    ;
    private final String code;
    private final String desc;

}
